/* 用户登录角色map*/
export const roleMap = { 1: "customer", 2: "manager" };

export const roleReflectMap = (() => {
  const result = {};
  Object.keys(roleMap).forEach(key => {
    const value = roleMap[key];
    result[value] = key;
  });
  return result;
})();

/* 客户经理是否收件列表*/
export const isSendList = [false, true];

/* 接口环境map */
export const APIENV = {
  local: "http://localhost:3000/",
  dev: "https://www.easy-mock.com/mock/5d034348e84f7b76b12df4a8/example_copy",
  sit: "http://inssit.onebank.com.cn/InsAccountServer",
  uat: "http://insuat.onebank.com.cn/InsAccountServer",
  pre: "https://inspre.onebank.com.cn/InsAccountServer",
  prod: "https://ins.onebank.com.cn/InsAccountServer"
};

/* 福州市行政区划代码 */
export const FuZhou = { cityCode: 350100, cityName: "福建省/福州市" };

/* 房产类型枚举 */
export const HouseTypeEnum = ["住宅", "别墅"];

/* 申请单状态 */
export const ApplyBillStatus = {
  /* 
  状态码  客户查看   经理查看
   0	    待收件     待收件
   1 	    审核中		 待处理
   2 	    放款中 		 放款中
   3 	    已放款		 已放款
  -1 	    待提交		 待提交
  -2 	    已关闭		 已拒绝
  -3 	    已取消		 客户取消
   */
  "0": {
    customer: "待收件",
    manager: "待收件"
  },
  "1": {
    customer: "已收件",
    manager: "待处理"
  },
  "2": {
    customer: "审核中",
    manager: "放款中"
  },
  "3": {
    customer: "已放款",
    manager: "已放款"
  },
  "-1": {
    customer: "待提交",
    manager: "客户待提交"
  },
  "-2": {
    customer: "已关闭",
    manager: "已拒绝"
  },
  "-3": {
    customer: "已取消",
    manager: "客户取消"
  }
};

/* 申请单状态反射 */
export const ApplyBillStatusReflect = (() => {
  const result = {};
  Object.keys(ApplyBillStatus).forEach(key => {
    result[ApplyBillStatus[key].manager] = key;
  });
  return result;
})();
